﻿<script src="~/Scripts/ChurchControllers/ChurchMembersController.js"></script>
<div class="row" ng-controller="ChurchMembersController">
    <div class="search-bar collapsed">
        <div class="form-group">
            <div class="input-group input-group-lg">
                <input type="text" class="form-control" placeholder="Type to search..." ng-model="searchkey" ng-change="Search()">
                <span class="input-group-btn">
                    <button class="btn btn-square btn-lg btn-default no-shadow close-search-bar" type="button" ng-click="searchkey='';Search();"><i class="zmdi zmdi-close"></i></button>
                </span>
            </div>
        </div>
    </div>
    <div class="col-md-12">
        <div class="bg-white bs-0 mb-20 widget">
            <div class="custom-grid-header">
                <div class="custom-grid-name">
                    Church Members
                </div>
                <div class="custom-grid-menu">
                    <ul class="custom-grid-menu-ul pull-right">
                        <li class="custom-grid-menu-ul-li dropdown">
                            <a href="javascript:;" class="dropdown-toggle text-white"><i class="zmdi zmdi-sort"></i></a>
                            <ul class="dropdown-menu dropdown-menu-right animated flipInY" style="margin-top: 4px; padding: 0px; width: 220PX;">
                                <li class="sortmenu" ng-click="sortby='DEFAULT';sort()" ng-class="{sortactive:sortby=='DEFAULT'}">
                                    <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                    <div class="sort-col-2">Default</div>
                                    <div class="clearfix"></div>
                                </li>
                                <li class="sortmenu" ng-click="sortby='NAME';sort()" ng-class="{sortactive:sortby=='NAME'}">
                                    <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                    <div class="sort-col-2">Name</div>
                                    <div class="clearfix"></div>
                                </li>
                                <li class="sortmenu" ng-click="sortby='FAMILYNAME';sort()" ng-class="{sortactive:sortby=='FAMILYNAME'}">
                                    <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                    <div class="sort-col-2">Family Name</div>
                                    <div class="clearfix"></div>
                                </li>
                                <li class="sortmenu" ng-click="sortby='EMAIL';sort()" ng-class="{sortactive:sortby=='EMAIL'}">
                                    <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                    <div class="sort-col-2">Email</div>
                                    <div class="clearfix"></div>
                                </li>
                                <li class="sortmenu" ng-click="sortby='PHONE';sort()" ng-class="{sortactive:sortby=='PHONE'}">
                                    <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                    <div class="sort-col-2">Phone</div>
                                    <div class="clearfix"></div>
                                </li>
                                <li class="sortmenu" ng-click="sortby='FAMILYNO';sort()" ng-class="{sortactive:sortby=='FAMILYNO'}">
                                    <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                    <div class="sort-col-2">Refference Number</div>
                                    <div class="clearfix"></div>
                                </li>
                                <li class="sortmenu" ng-click="sortby='MEMBERNO';sort()" ng-class="{sortactive:sortby=='MEMBERNO'}">
                                    <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                    <div class="sort-col-2">Member Number</div>
                                    <div class="clearfix"></div>
                                </li>
                            </ul>
                        </li>
                    </ul>
                    <div class="clearfix"></div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="widget-body">
                <div class="row">
                    <div class="col-md-12" ng-show="viewmode=='TABLE'">
                        <table class="table table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th style="width: 8%">REF NO</th>
                                    <th style="width: 8%">TITLE</th>
                                    <th style="width: 8%">INITIAL</th>
                                    <th style="width: 14%">FULL NAME</th>
                                    <th style="width: 15%">FAMILY NAME</th>
                                    <th style="width: 10%">EMAIL</th>
                                    <th style="width: 10%">PHONE</th>
                                    <th style="width: 10%">DATE OF BIRTH</th>
                                    <th style="width: 15%">ACTION&nbsp;</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="data in list">
                                    <td>{{data.MemberNumber}}</td>
                                    <td>{{data.NameTitle.NameTitle}}</td>
                                    <td>{{data.Initial}}</td>
                                    <td>{{data.FirstName}} {{data.MiddleName}} {{data.LastName}}</td>
                                    <td>{{data.Family.FamilyName}}</td>
                                    <td>{{data.Email}}</td>
                                    <td>{{data.Phone}}</td>
                                    <td>{{data.DateOfBirth}}</td>
                                    <td>
                                        <div class="btn-group-sm" role="group" aria-label="Second group">
                                            <button type="button" class="btn btn-info waves-effect" ng-click="toggle('edit',data.ChurchWorkerId);"><i class="fa fa-pencil"></i></button>
                                            <button type="button" class="btn btn-danger waves-effect" ng-click="delete(data.FullName,data.ChurchWorkerId)"><i class="fa fa-trash"></i></button>
                                            <a class="btn btn-success waves-effect" href="ChurchWorkers/ChurchWorkerInfo?ChurchWorkerId={{data.ChurchWorkerId}}"><i class="fa fa-info-circle"></i></a>
                                            <a class="btn btn-purple waves-effect" target="_blank" href="ChurchWorkers/PrintChurchWorkerDetails?ChurchWorkerId={{data.ChurchWorkerId}}"><i class="zmdi zmdi-print"></i></a>
                                            @*<a class="btn btn-primary waves-effect" target="_blank" href="ChurchWorkers/ChurchWorkerInfo?ChurchWorkerId={{data.ChurchWorkerId}}"><i class="fa fa-print"></i></a>
                                                <a class="btn btn-warning waves-effect" title="Documents" ng-click="ChurchWorker(data.ChurchWorkerId)"><i class="fa fa-file-archive-o"></i></a>
                                                <a class="btn btn-gray waves-effect" title="Language" ng-click="ChurchWorker(data.ChurchWorkerId)"><i class="zmdi zmdi-speaker"></i></a>
                                                <a class="btn btn-lime waves-effect" title="Designation" ng-click="ChurchWorker(data.ChurchWorkerId)"><i class="zmdi zmdi-input-antenna"></i></a>
                                                <a class="btn btn-orange waves-effect" title="Family Details" ng-click="ChurchWorker(data.ChurchWorkerId)"><i class="zmdi zmdi-local-florist"></i></a>
                                                <a class="btn btn-purple waves-effect" title="Left Organization" ng-click="ChurchWorker(data.ChurchWorkerId)"><i class="zmdi zmdi-arrow-forward"></i></a>
                                                <a class="btn btn-info waves-effect" title="Activate/Deactivate" ng-click="ChurchWorker(data.ChurchWorkerId)"><i class="zmdi zmdi-arrow-split"></i></a>
                                                <a class="btn btn-info waves-effect" title="Create Login" ng-click="ChurchWorker(data.ChurchWorkerId)"><i class="zmdi zmdi-arrow-split"></i></a>*@
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="col-md-12" ng-show="viewmode=='CARD'">
                        <ul class="card">
                            <li ng-repeat="data in list">
                                <div class="card-container">
                                    <div class="card-container-row">
                                        <div class="card-image">
                                            <img class="media-object mo-lg img-circle mCS_img_loaded" src="/Uploads/uploaded/_productlogo.png" alt="">
                                        </div>
                                        <div class="card-details">
                                            <div class="card-details-row-1"><i class="fa fa-user"></i>{{data.FullName}}</div>
                                            <div class="card-details-row-2"><i class="fa fa-phone"></i>{{data.Phone}}</div>
                                            <div class="card-details-row-3"><i class="zmdi zmdi-email"></i>{{data.Email}}</div>
                                        </div>
                                        <div class="clearfix"></div>
                                    </div>
                                    <div class="card-action">
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div gridloader></div>
                    <div nodata></div>
                </div>
                <div ng-show="list.length > 0" style="padding-right: 10px; text-align: right;">
                    <div pagination="" page="currentPage" max-size="10" on-select-page="setPage(page)" boundary-links="true" total-items="filteredItems" items-per-page="entryLimit" class="pagination-small" previous-text="«" next-text="»"></div>
                </div>
            </div>
        </div>
    </div>
</div>

